package com.neusoft.elmboot.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import com.neusoft.elmboot.po.Rating;

@Repository
public interface RatingMapper {
	@Select("select * from rating where businessId=#{businessId}")
	List<Rating> listRatingsByBisinessId(Integer businessId);
	
	@Select("select text from recommend where ratingId=#{ratingId}")
	List<String> listRecommendByRatingId(Integer ratingId);
	
	@Select("select count(*) from rating where businessId=#{businessId}")
	Integer getRatingCountByBusinessId(Integer businessId);
	
	@Select("select avg(score) from rating where businessId=#{businessId}")
	Double getMeanScoreByBusinessId(Integer businessId);
	
}
